package com.learn.project2.model.vo.admin;

import com.learn.project2.bean.MarketRole;
import lombok.Data;

import java.util.List;

/**
 * @Classname RoleListVO
 * @Description
 * @author王茁
 * @Date 2022/1/6 21:50
 */
@Data
public class RoleListVO {

    /**
     * total : 4
     * pages : 1
     * limit : 20
     * page : 1
     * list : [{"id":4,"name":"杯莫停","desc":"心悦3","enabled":true,"addTime":"2022-01-06 20:07:42","updateTime":"2022-01-06 20:08:52","deleted":false},{"id":1,"name":"超级管理员","desc":"所有模块的权限","enabled":true,"addTime":"2019-01-01 00:00:00","updateTime":"2019-01-01 00:00:00","deleted":false},{"id":2,"name":"商场管理员","desc":"只有商场模块的操作权限","enabled":true,"addTime":"2019-01-01 00:00:00","updateTime":"2019-01-07 15:15:12","deleted":false},{"id":3,"name":"推广管理员","desc":"只有推广模块的操作权限","enabled":true,"addTime":"2019-01-01 00:00:00","updateTime":"2019-01-07 15:15:24","deleted":false}]
     */

    private Integer total;
    private Integer pages;
    private Integer limit;
    private Integer page;
    public List<MarketRole> list;

    public static RoleListVO roleListVO(long total, Integer pages, Integer limit, List<MarketRole> list) {
        RoleListVO roleListVO = new RoleListVO();
        roleListVO.setTotal((int) total);
        roleListVO.setPages(pages);
        roleListVO.setLimit(limit);
        roleListVO.setList(list);
        return roleListVO;
    }
}
